package com.mytwo.mysecond.Service.ServiceImpl;

import com.mytwo.mysecond.Service.UserService;
import com.mytwo.mysecond.bean.UserDO;
import com.mytwo.mysecond.dao.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author bobo
 * @description: ${description}
 * @date 2018-05-03 12:16
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDAO userDAO;
    @Override
    public String userLogin(String userName, String passWord) {
        UserDO userDO = userDAO.getByUserNameAndPassword(userName, passWord);
        if (userDO == null){
            return "register";
        }else {
            return "index";
        }
    }
    @Override
    public String getMessage() {
        UserDO byPrimary = userDAO.getByPrimary(1L);
        System.out.println(byPrimary.getUserName());
        System.out.println(byPrimary.getPassWord());

        return null;
    }
}
